package com.woniuxy.buyer.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 订单实体
 */
@Data
@TableName("orders")
public class Order {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String orderNo;

    private Long buyerId;

    private Long sellerId;

    private Long productId;

    private String productName;

    private Integer pointsRequired;

    private Integer quantity;

    private Integer totalPoints;

    private String status; // PENDING, COMPLETED, CANCELLED, REFUNDED

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    // 非数据库字段
    @TableField(exist = false)
    private String buyerName;

    @TableField(exist = false)
    private String sellerName;
}
